package org.qiyu.live.user.provider;

import jakarta.annotation.Resource;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.qiyu.live.user.dto.UserLoginDTO;
import org.qiyu.live.user.provider.service.IUserPhoneService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * 作者：無言
 * 时间：2024/11/13 14:48
 * 描述：dubbo服务启动类
 */
@SpringBootApplication
@EnableDubbo
@EnableDiscoveryClient
public class UserProvideApplication implements CommandLineRunner {

    @Resource
    private IUserPhoneService userPhoneService;

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(UserProvideApplication.class);
        springApplication.setWebApplicationType(WebApplicationType.NONE);
        springApplication.run(args);
    }

    @Override
    public void run(String... args) throws Exception {
//        String phone = "15975926082";
//        UserLoginDTO userLoginDTO = userPhoneService.login(phone);
//        System.out.println(userLoginDTO);
//        System.out.println(userPhoneService.queryByUserId(userLoginDTO.getUserId()));
//        System.out.println(userPhoneService.queryByUserId(userLoginDTO.getUserId()));
//        System.out.println(userPhoneService.queryByPhone(phone));
//        System.out.println(userPhoneService.queryByPhone(phone));
    }
}
